﻿<Window x:Class="DropBoxLinker.frmSettings" Title="DropBox Linker"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:DropBoxLinker"
        MinWidth="400" WindowStartupLocation="CenterScreen" 
        SizeToContent="WidthAndHeight" ResizeMode="NoResize"
        UseLayoutRounding="True" RenderOptions.BitmapScalingMode="NearestNeighbor"
        local:WindowBehavior.HideCloseButton="True"
        Icon="/DropBoxLinker;component/DropBoxLinker.ico">
    
    <Window.Resources>
        
        <!-- title label -->
        <Style TargetType="TextBlock" x:Key="PropertyTitle">
            <Setter Property="FontSize" Value="13" />
            <Setter Property="Margin" Value="2,5,0,4" />
        </Style>
        
        <!-- input box -->
        <Style TargetType="FrameworkElement" x:Key="PropertyInput">
            <Setter Property="Margin" Value="10,0,0,0" />
        </Style>
        
        <!-- change link-label -->
        <Style TargetType="TextBlock" x:Key="SmallGrayText">
            <Setter Property="Foreground" Value="Gray" />
            <Setter Property="FontSize" Value="11" />
            <Setter Property="HorizontalAlignment" Value="Left" />
        </Style>
        <Style TargetType="TextBlock" x:Key="PropertyChangeLink" BasedOn="{StaticResource SmallGrayText}">
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Margin" Value="15,0,0,0" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Foreground" Value="DimGray" />
                    <Setter Property="TextDecorations" Value="Underline" />
                </Trigger>
            </Style.Triggers>
        </Style>
        

    </Window.Resources>
    
  
    <Grid Margin="10,6">
                
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="4*" />
            <ColumnDefinition Width="10" />
            <ColumnDefinition Width="6*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <!-- icon -->
        <Image Source="/DropBoxLinker;component/graphics/icon24.png"
               Stretch="None" VerticalAlignment="Top" Margin="0,3,8,0" />

        <!-- title -->
        <TextBlock Text="User settings" FontSize="20" FontWeight="Light"
                    Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" />

        <!-- public sync directory -->
        <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="panSyncDirectory">
            <TextBlock Text="public sync directory" Style="{StaticResource PropertyTitle}" />
            <TextBox Name="txtSyncDirectory" Text="{Binding SyncDirectory, UpdateSourceTrigger=PropertyChanged, FallbackValue='D:\\Data\\dropbox\\Public'}" Style="{StaticResource PropertyInput}" />
            <TextBlock Text="choose directory" Style="{StaticResource PropertyChangeLink}" MouseDown="OnSelectSyncDirectory" />
        </StackPanel>

        <!-- user id -->
        <StackPanel Grid.Row="2" Grid.Column="1">
            <TextBlock Text="user id" Style="{StaticResource PropertyTitle}" />
            <TextBox Name="txtUserID" Style="{StaticResource PropertyInput}" Text="{Binding UserID, FallbackValue='234235234'}" />
            <TextBlock Text="where can I get it?" Style="{StaticResource PropertyChangeLink}" MouseDown="OnWhereToGetUserID" />
        </StackPanel>

        <!-- popup timeout -->
        <DockPanel Grid.Row="2" Grid.Column="3">

            <!-- title & value -->
            <TextBlock Text="popup timeout" Style="{StaticResource PropertyTitle}" DockPanel.Dock="Top" />
            <Slider Margin="6,0,0,0" HorizontalAlignment="Stretch" DockPanel.Dock="Top"
                    Minimum="1" Maximum="5" Value="{Binding PopupTimeout, FallbackValue='3.0'}"
                    PreviewMouseUp="OnPopupTimeoutChanged" />

            <!-- min, max ticks -->
            <DockPanel>
                <TextBlock Text="1 sec." Style="{StaticResource SmallGrayText}" Margin="10,0,0,0" />
                <TextBlock Text="5 sec." Style="{StaticResource SmallGrayText}"
                            HorizontalAlignment="Right" Margin="0,0,5,0" />
            </DockPanel>

        </DockPanel>

        <!-- clipboard policy -->
        <StackPanel Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3">
            <TextBlock Text="clipboard policy" Style="{StaticResource PropertyTitle}" />
            <CheckBox IsChecked="{Binding CleanClipboard, FallbackValue=False}" Margin="12,-1,0,0" Content="Clean out clipboard before copying each link" />
            <TextBlock Text="uncheck to append new links to already existing" Style="{StaticResource SmallGrayText}" Margin="29,-2,0,0" />
        </StackPanel>

        <!-- autostart -->
        <StackPanel Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3">
            <TextBlock Text="auto startup" Style="{StaticResource PropertyTitle}" />
            <CheckBox IsChecked="{Binding AutoStartup, FallbackValue=True}" Margin="12,-1,0,0" Content="Start this program automatically with Windows" />
            <TextBlock Text="required to monitor your DropBox after logoff/reboot" Style="{StaticResource SmallGrayText}" Margin="29,-2,0,0" />
        </StackPanel>

        <!-- commands -->
        <StackPanel Grid.Row="5" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
            <Button Content="Apply" IsDefault="True" Padding="18,2" Margin="0,0,7,0" Click="OnApply" />
            <Button Content="Cancel" IsCancel="True" Padding="18,2" Click="OnCancel" />
        </StackPanel>

    </Grid>

       
    
</Window>
